package org.dei.perla.rockfall.gui.queryforge;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

class GainsStatusGeophoneYPanel extends ReadableStatusPanel {

	private JTextField jText2;
	
	protected GainsStatusGeophoneYPanel(String title) {
		super(title);
	}


	@Override
	protected int getStatus() throws IllegaParamValueException {
		int result = Integer.parseInt(jText2.getText());
		if(result > 255)
			throw new IllegaParamValueException("Parametro impostato troppo elevato per geoy (< 255)");
		return result;
	}

	@Override
	protected void setStatus(int stato) {
		jText2.setText(Integer.toString(stato));
	}

	@Override
	protected void setupInternalComponents() {
		
		//Primo blocco di scelte
		
		jText2 = new JTextField();
		jText2.setColumns(10);
		JLabel jlabel2 = new JLabel("Guadagno geofono asse Y");
		JPanel jpanel2 = new JPanel();
		jText2.setText("0");
		BoxLayout layout2 = new BoxLayout(jpanel2, BoxLayout.X_AXIS);
		jpanel2.add(jlabel2);
		jpanel2.add(jText2);


		//aggiungo tutti i blocchi
		this.add(jpanel2);
		
	}

}
